import { axios } from '@/utils/request'
import { mimeMap, resolveBlob, resolveUrl } from '@/utils/download'

const tenantId = localStorage.getItem('tenantId')

const api = {
  user: '/system/user',
  role: '/system/role',
  permission: '/system/menu',
  appPermission: '/system/sys-app-menu',
  dept: '/system/dept',
  dictType: '/system/dict/type',
  dictData: '/system/dict/data',
  dist: '/system/districts',
  config: '/system/config',
  oss: '/system/dfs',
  settingInfo: '/system/operator/setting/info',
  settingUpdate: '/system/operator/setting/update',
  statistics: '/report/statistics/list',
  changePwd: '/system/accounts/pwd',

  // 字典
  dataType: '/system/dict/data/type',
  hydwWzd: '/system/dict/data/type?dictType=hydw_wzd', // 资料完成度
  attacheList: '/admin/headquarters-attache/getAttacheList', // 专员分组

  // 会员管理
  addAttacheList: '/system/member/headquarters/addAttache', // 会员列表添加专员
  memberLevel: '/system/memberLevel/getList', // 申请职务列表
  paymentRecord: '/system/member/headquarters/paymentRecord/add',
  memberLevelGetDownList: '/system/memberLevel/getDownList',
  memberQuit: '/system/member/headquarters/quit',
  memberRecover: '/system/member/headquarters/recover',
  sendComplete: '/system/member/headquarters/send/completeMessage',

  memberTypeGetList: '/system/memberType/getList',
  memberTypeGetDownList: '/system/memberType/getDownList',
  memberTypeAdd: '/system/memberType/add',
  memberTypeEdit: '/system/memberType/edit',
  memberTypeDel: '/system/memberType/del',
  memberTypeEnable: '/system/memberType/enable',

  industryGetList: '/system/industry/getList',
  orgIndustryGetDownList: '/system/org/industry/getDownList',
  industryAdd: '/system/industry/add',
  industryEdit: '/system/industry/edit',
  industryGetInfo: '/system/industry/getInfo',
  industryDel: '/system/industry/del',
  industryEnable: '/system/industry/enable',

  memberRatingList: '/admin/member-rating/getList',
  memberRatingAdd: '/admin/member-rating/add',
  memberRatingEdit: '/admin/member-rating/edit',
  memberRatingDelete: '/admin/member-rating/del',
  memberRatingEnable: '/admin/member-rating/enable',

  memberTownsList: '/admin/member-towns/getList',
  memberTownsAdd: '/admin/member-towns/add',
  memberTownsEdit: '/admin/member-towns/edit',
  memberTownsDelete: '/admin/member-towns/del',
  memberTownsEnable: '/admin/member-towns/enable',

  orgList: '/system/dept/v2/org_list',
  orgCreate: '/system/dept/v2/create_org',
  deptList: '/system/dept/v2/dept_list',
  deptCreate: '/system/dept/v2/create_dept',
  deptEdit: '/system/dept/v2/edit',
  deptRemove: '/system/dept/v2/remove',

  postList: '/system/post/list',
  postCreate: '/system/post/create',
  postEdit: '/system/post/edit',
  postRemove: '/system/post/remove',

  staffList: '/system/staff/list',
  staffGet: '/system/staff/get',
  staffCreate: '/system/staff/create',
  staffEdit: '/system/staff/edit',
  staffRemove: '/system/staff/remove',

  headquartersPageList: '/system/member/headquarters/pageList',
  memberCompanyShow: '/admin/member-company/show',
  memberLeadingShow: '/admin/member-leading/show',

  responsiblePersonList: '/system/member/headquarters/responsiblePerson/pageList',
  responsiblePersonAdd: '/system/member/headquarters/responsiblePerson/add',
  responsiblePersonUpdate: '/system/member/headquarters/responsiblePerson/update',
  responsiblePersonDel: '/system/member/headquarters/responsiblePerson/delete',

  leadingMemberList: '/system/member/headquarters/leadingMember/pageList',
  queryNotRegistration: '/admin/activityRegister/queryNotRegistration', //总会负责人，带openid
  leadingMemberAdd: '/system/member/headquarters/leadingMember/add',
  leadingMemberUpdate: '/system/member/headquarters/leadingMember/update',
  leadingMemberDetail: '/system/member/headquarters/leadingMember/info',
  leadingMemberDel: '/system/member/headquarters/leadingMember/delete',

  headquartersSettingBaseGet: '/system/headquarters_setting/base/get',
  headquartersSettingBaseCreateOrEdit: '/system/headquarters_setting/base/create_or_edit',

  extVisionList: '/system/headquarters_setting/ext/vision/list',
  extVisionCreateOrEdit: '/system/headquarters_setting/ext/vision/create_or_edit',
  extVisionRemove: '/system/headquarters_setting/ext/vision/remove',

  extVideoGet: '/system/headquarters_setting/ext/video/get',
  extVideoCreateOrEdit: '/system/headquarters_setting/ext/video/create_or_edit',

  structureImgGet: '/system/headquarters_setting/ext/structureImg/get', //获取机构组织架构图
  structureImgCreateOrEdit: '/system/headquarters_setting/ext/structureImg/create_or_edit', //设置结构组织架构图

  extBigGet: '/system/headquarters_setting/ext/service/big/get',
  extBigCreateOrEdit: '/system/headquarters_setting/ext/service/big/create_or_edit',

  extSmallDetailList: '/system/headquarters_setting/ext/service/small/detail/list',
  extSmallDetailCreateOrEdit: '/system/headquarters_setting/ext/service/small/detail/create_or_edit',
  extSmallDetailRemove: '/system/headquarters_setting/ext/service/small/detail/remove',

  elegantlList: '/system/elegant/getList',
  elegantlAdd: '/system/elegant/add',
  elegantlEdit: '/system/elegant/edit',
  elegantlDel: '/system/elegant/del',

  extPlatformList: '/system/headquarters_setting/ext/platform/list',
  extPlatformCreateOrEdit: '/system/headquarters_setting/ext/platform/create_or_edit',
  extPlatformRemove: '/system/headquarters_setting/ext/platform/remove',

  extPlatformDetailList: '/system/headquarters_setting/ext/platform/detail/list',
  extPlatformDetailCreateOrEdit: '/system/headquarters_setting/ext/platform/detail/create_or_edit',
  extPlatformDetailRemove: '/system/headquarters_setting/ext/platform/detail/remove',

  headquartersRuleList: '/admin/headquartersRule/list',
  headquartersRuleEdit: '/admin/headquartersRule/edit',

  orgStructList: '/system/headquarters_org_struct/list',
  orgStructCreateOrEdit: '/system/headquarters_org_struct/create_or_edit',
  orgStructRemove: '/system/headquarters_org_struct/remove',

  orgStructExcelImport: '/system/headquarters_org_struct/excel_import',
  staticExcel: '/system/static/excel',

  accountsresetMemberPwd: '/system/accounts/resetMemberPwd',

  leadingMemberExportTemplate: '/system/member/headquarters/leadingMember/exportTemplate',
  leadingMemberImportExcel: '/system/member/headquarters/leadingMember/importExcel',
  leadingMemberExportEecel: '/system/member/headquarters/leadingMember/exportExcel',
  responsiblePersonExportTemplate: '/system/member/headquarters/responsiblePerson/exportTemplate',
  responsiblePersonImportExcel: '/system/member/headquarters/responsiblePerson/importExcel',
  responsiblePersonExportEecel: '/system/member/headquarters/responsiblePerson/exportExcel',
  customExportExcel: '/system/member/headquarters/customExportExcel',

  extSamllDetailRecover: '/system/headquarters_setting/ext/service/small/detail/recover',
  extPlatformDetailRecover: '/system/headquarters_setting/ext/platform/detail/recover',
  orgStructRecover: '/system/headquarters_org_struct/recover',

  headquartersInfo4Review: '/system/member/headquarters/info4Review',
  leadingMemberPageList4Review: '/system/member/headquarters/leadingMember/pageList4Review',
  responsiblePersonPageList4Review: '/system/member/headquarters/responsiblePerson/pageList4Review',
  honorPageList4Review: '/system/member/headquarters/honor/pageList4Review',

  headquartersReview: '/system/member/headquarters/review',

  userExportTemplate: '/system/user/exportTemplate',
  userExportExcel: '/system/user/exportExcel',
  userImportExcel: '/system/user/importExcel',

  staffExportExcel: '/system/staff/excel_export',
  staffImportExcel: '/system/staff/excel_import',

  getAuthUrl: '/admin/wx3rd/getAuthUrl', //获取授权地址
  getAuthStatus: '/admin/wx3rd/getAuthStatus', //获取授权状态

  domainList: '/admin/wx3rd/getEffectiveJumpDomain', //小程序域名列表
  downLoadVerifFile: `/admin/wx3rd/getJumpDomainConfirmFile?tenantId=${tenantId}`, //下载校验文件
  domainAction: '/admin/wx3rd/modifyJumpDomainDirectly' //业务域名操作
}

export default api

/**
 * 会员列表添加专员
 */
export function addAttacheList(data) {
  return axios({
    url: api.addAttacheList + '/' + data.id + '/' + data.attacheId,
    method: 'post'
  })
}

/**
 * 职务
 */
export function memberLevel(params) {
  return axios({
    url: api.memberLevel,
    method: 'get',
    params
  })
}

/**
 * 续费
 */
export function paymentRecord(data) {
  return axios({
    url: api.paymentRecord,
    method: 'post',
    data
  })
}

/**
 * 总会会员退会
 */
export function memberQuit(data) {
  return axios({
    url: api.memberQuit + '/' + data.id,
    method: 'post'
  })
}

/**
 * 总会会员恢复
 */
export function memberRecover(data) {
  return axios({
    url: api.memberRecover + '/' + data.id,
    method: 'post'
  })
}

/**
 * 通知完善资料
 */
export function sendComplete(data) {
  return axios({
    url: api.sendComplete + '/' + data.id,
    method: 'get',
    data
  })
}

/**
 * 资料完成度
 */
export function hydwWzd() {
  return axios({
    url: api.hydwWzd,
    method: 'get'
  })
}

/**
 * 专员分组
 */
export function attacheList(data) {
  return axios({
    url: api.attacheList,
    method: 'post',
    data
  })
}

export function getStatisticsList(parameter) {
  return axios({
    url: api.statistics,
    method: 'get'
  })
}
// user
export function getUserList(parameter) {
  return axios({
    url: api.user + '/list',
    method: 'get',
    params: parameter
  })
}

// role
export function saveUser(parameter) {
  return axios({
    url: api.user + (parameter.userId !== 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function delUser(parameter) {
  return axios({
    url: api.user + '/remove',
    method: 'post',
    params: parameter
  })
}
export function changUserStatus(parameter) {
  return axios({
    url: api.user + '/status',
    method: 'post',
    data: parameter
  })
}
export function resetPwd(parameter) {
  return axios({
    url: api.user + '/resetPwd',
    method: 'post',
    data: parameter
  })
}

// role
export function getRole4AdminList(parameter) {
  return axios({
    url: api.role + '/list/4admin',
    method: 'get',
    params: parameter
  })
}
export function getRole4AdminAll() {
  return axios({
    url: api.role + '/all/4admin',
    method: 'get'
  })
}
// role - LEVEL
export function getRoleList(parameter) {
  return axios({
    url: api.role + '/list',
    method: 'get',
    params: parameter
  })
}
export function getRoleAll() {
  return axios({
    url: api.role + '/all',
    method: 'get'
  })
}

export function saveRole(parameter) {
  return axios({
    url: api.role + (parameter.roleId > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function saveAdminRole(parameter) {
  return axios({
    url: api.role + (parameter.roleId > 0 ? '/update' : '/saveAdmin'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delRole(parameter) {
  return axios({
    url: api.role + '/remove',
    method: 'post',
    params: parameter
  })
}
export function changRoleStatus(parameter) {
  return axios({
    url: api.role + '/status',
    method: 'post',
    data: parameter
  })
}
export function authDataScope(parameter) {
  return axios({
    url: api.role + '/authDataScope',
    method: 'post',
    data: parameter
  })
}

// user-menu
export function getUserPermissions(parameter) {
  return axios({
    url: api.permission + '/user_auths',
    method: 'get',
    params: parameter
  })
}

/**
 * @description 获取小程序权限路由列表
 * @date 08/04/2024
 * @export
 */
export function getAppPermissions(parameter) {
  return axios({
    url: api.appPermission + '/user_auths',
    method: 'get',
    params: parameter
  })
}

export function getPermissions(parameter) {
  return axios({
    url: api.permission + '/list',
    method: 'get',
    params: parameter
  })
}
export function get4TenantPermissions(parameter) {
  return axios({
    url: api.permission + '/list_4_tenant',
    method: 'get',
    params: parameter
  })
}
export function getRolePermIds(roleId) {
  return axios({
    url: api.permission + '/role/' + `${roleId}`,
    method: 'get'
  })
}

export function getRolePermIdsWithSysType(roleId, sysType) {
  return axios({
    url: api.permission + `/role/${roleId}/${sysType}`,
    method: 'get'
  })
}

/**
 * @description 获取角色绑定的小程序权限路由id
 * @date 08/04/2024
 * @export
 * @param {*} roleId
 * @param {*} sysType
 */
export function getAppRolePermIdsWithSysType(roleId, sysType) {
  return axios({
    url: api.appPermission + `/role/${roleId}/${sysType}`,
    method: 'get'
  })
}

export function savePerm(parameter) {
  return axios({
    url: api.permission + (parameter.menuId > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delPerm(deptId) {
  return axios({
    url: api.permission + '/remove/' + `${deptId}`,
    method: 'post'
  })
}

// dept
export function getDeptList(parameter) {
  return axios({
    url: api.dept + '/list',
    method: 'get',
    params: parameter
  })
}
export function getRoleDeptIds(roleId) {
  return axios({
    url: api.dept + '/role/' + `${roleId}`,
    method: 'get'
  })
}
export function saveDept(parameter) {
  return axios({
    url: api.dept + (parameter.deptId > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delDept(deptId) {
  return axios({
    url: api.dept + '/remove/' + `${deptId}`,
    method: 'post'
  })
}
// dictType
export function getDictTypeList(parameter) {
  return axios({
    url: api.dictType + '/list',
    method: 'get',
    params: parameter
  })
}
export function saveDictType(parameter) {
  return axios({
    url: api.dictType + (parameter.dictId > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function delDictType(parameter) {
  return axios({
    url: api.dictType + '/remove',
    method: 'post',
    params: parameter
  })
}

// dictData
export function getDictDataList(parameter) {
  return axios({
    url: api.dictData + '/list',
    method: 'get',
    params: parameter
  })
}
export function saveDictData(parameter) {
  return axios({
    url: api.dictData + (parameter.dictCode > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function delDictData(parameter) {
  return axios({
    url: api.dictData + '/remove',
    method: 'post',
    params: parameter
  })
}
// dist 地区
export function getDistList(parameter) {
  return axios({
    url: api.dist + '/list',
    method: 'get',
    params: parameter
  })
}
export function saveDist(parameter) {
  return axios({
    url: api.dist + (parameter.id > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function delDist(parameter) {
  return axios({
    url: api.dist + '/remove',
    method: 'post',
    params: parameter
  })
}
// config 配置
export function getConfigList(parameter) {
  console.log('getConfigList', parameter)
  return axios({
    url: api.config + '/list',
    method: 'get',
    params: parameter
  })
}
export function saveConfig(parameter) {
  return axios({
    url: api.config + (parameter.configId > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function delConfig(parameter) {
  return axios({
    url: api.config + '/remove/' + parameter.ids,
    method: 'post'
  })
}
// oss
export function getOssList(parameter) {
  return axios({
    url: api.oss + '/list',
    method: 'get',
    params: parameter
  })
}
export function saveOss(parameter) {
  return axios({
    url: api.oss + (parameter.id > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function delOss(parameter) {
  return axios({
    url: api.oss + '/remove',
    method: 'post',
    params: parameter
  })
}
export function getOssConfig() {
  return axios({
    url: api.oss + '/config',
    method: 'get'
  })
}
export function saveOssConfig(parameter) {
  return axios({
    url: api.oss + '/saveConfig',
    method: 'post',
    params: parameter
  })
}

export function settingInfo() {
  return axios({
    url: api.settingInfo,
    method: 'get'
  })
}

export function settingUpdate(parameter) {
  return axios({
    url: api.settingUpdate,
    method: 'post',
    data: parameter
  })
}

export function changePwd(parameter) {
  return axios({
    url: api.changePwd,
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function dataType(parameter) {
  return axios({
    url: api.dataType,
    method: 'get',
    params: parameter
  })
}

/**
 * 会员级别下拉
 */
export function memberLevelGetDownList(params) {
  return axios({
    url: api.memberLevelGetDownList,
    method: 'get',
    params
  })
}

/**
 * 会员类型列表
 */
export function memberTypeGetList(params) {
  return axios({
    url: api.memberTypeGetList,
    method: 'get',
    params
  })
}

/**
 * 会员类型下拉
 */
export function memberTypeGetDownList(params) {
  return axios({
    url: api.memberTypeGetDownList,
    method: 'get',
    params
  })
}

/**
 * 会员类型新增
 */
export function memberTypeAdd(data) {
  return axios({
    url: api.memberTypeAdd,
    method: 'post',
    data
  })
}

/**
 * 会员类型编辑
 */
export function memberTypeEdit(data) {
  return axios({
    url: api.memberTypeEdit,
    method: 'post',
    data
  })
}

/**
 * 会员类型删除
 */
export function memberTypeDel(data) {
  return axios({
    url: api.memberTypeDel + '/' + data.ids,
    method: 'post'
  })
}

/**
 * 会员类型禁用启用
 */
export function memberTypeEnable(data) {
  return axios({
    url: api.memberTypeEnable + '/' + data.id + '/' + data.status,
    method: 'post',
    data
  })
}

/**
 * 行业管理列表
 */
export function industryGetList(params) {
  return axios({
    url: api.industryGetList,
    method: 'get',
    params
  })
}

/**
 * 机构行业下拉（跟运营端行业数据一致）
 */
export function OrgIndustryGetDownList() {
  return axios({
    url: api.orgIndustryGetDownList,
    method: 'get',
  })
}


/**
 * 行业管理新增
 */
export function industryAdd(data) {
  return axios({
    url: api.industryAdd,
    method: 'post',
    data
  })
}

/**
 * 行业管理编辑
 */
export function industryEdit(data) {
  return axios({
    url: api.industryEdit,
    method: 'post',
    data
  })
}

/**
 * 行业管理详情
 */
export function industryGetInfo(params) {
  return axios({
    url: api.industryGetInfo,
    method: 'get',
    params
  })
}

/**
 * 行业管理删除
 */
export function industryDel(data) {
  return axios({
    url: api.industryDel + '/' + data.ids,
    method: 'post'
  })
}

/**
 * 行业管理禁用启用
 */
export function industryEnable(data) {
  return axios({
    url: api.industryEnable + '/' + data.id + '/' + data.status,
    method: 'post',
    data
  })
}

/**
 * @description 等级评估列表
 * @date 03/04/2023
 * @export
 * @param {*} params
 */
export function memberRatingList(params) {
  return axios({
    url: api.memberRatingList,
    method: 'get',
    params
  })
}

/**
 * @description 等级评估 禁用启用
 * @date 03/04/2023
 * @export
 * @param {*} data
 */
export function memberRatingEnable(data) {
  return axios({
    url: api.memberRatingEnable + '/' + data.id + '/' + data.status,
    method: 'post',
    data
  })
}

/**
 * @description 等级评估删除
 * @date 03/04/2023
 * @export
 * @param {*} data
 */
export function memberRatingDelete(data) {
  return axios({
    url: api.memberRatingDelete + '/' + data.ids,
    method: 'post'
  })
}

/**
 * @description 等级评估添加
 * @date 03/04/2023
 * @export
 * @param {*} data
 */
export function memberRatingAdd(data) {
  return axios({
    url: api.memberRatingAdd,
    method: 'post',
    data
  })
}

/**
 * @description 等级评估编辑
 * @date 03/04/2023
 * @export
 * @param {*} data
 */
export function memberRatingEdit(data) {
  return axios({
    url: api.memberRatingEdit,
    method: 'post',
    data
  })
}

/**
 * @description 镇属列表
 * @date 03/04/2023
 * @export
 * @param {*} params
 */
export function memberTownsList(params) {
  return axios({
    url: api.memberTownsList,
    method: 'get',
    params
  })
}

/**
 * @description 镇属 禁用启用
 * @date 03/04/2023
 * @export
 * @param {*} data
 */
export function memberTownsEnable(data) {
  return axios({
    url: api.memberTownsEnable + '/' + data.id + '/' + data.status,
    method: 'post',
    data
  })
}

/**
 * @description 镇属 删除
 * @date 03/04/2023
 * @export
 * @param {*} data
 */
export function memberTownsDelete(data) {
  return axios({
    url: api.memberTownsDelete + '/' + data.ids,
    method: 'post'
  })
}

/**
 * @description 镇属 添加
 * @date 03/04/2023
 * @export
 * @param {*} data
 */
export function memberTownsAdd(data) {
  return axios({
    url: api.memberTownsAdd,
    method: 'post',
    data
  })
}

/**
 * @description 镇属 编辑
 * @date 03/04/2023
 * @export
 * @param {*} data
 */
export function memberTownsEdit(data) {
  return axios({
    url: api.memberTownsEdit,
    method: 'post',
    data
  })
}


/**
 * 组织列表
 */
export function orgList(params) {
  return axios({
    url: api.orgList,
    method: 'get',
    params
  })
}

/**
 * 组织新增
 */
export function orgCreate(data) {
  return axios({
    url: api.orgCreate,
    method: 'post',
    data
  })
}

/**
 * 部门列表
 */
export function deptList(params) {
  return axios({
    url: api.deptList,
    method: 'get',
    params
  })
}

/**
 * 部门新增
 */
export function deptCreate(data) {
  return axios({
    url: api.deptCreate,
    method: 'post',
    data
  })
}

/**
 * 组织、部门编辑
 */
export function deptEdit(data) {
  return axios({
    url: api.deptEdit,
    method: 'post',
    data
  })
}

/**
 * 组织、部门删除
 */
export function deptRemove(params) {
  return axios({
    url: api.deptRemove,
    method: 'post',
    params
  })
}

/**
 * 职务列表
 */
export function postList(params) {
  return axios({
    url: api.postList,
    method: 'get',
    params
  })
}

/**
 * 职务新增
 */
export function postCreate(data) {
  return axios({
    url: api.postCreate,
    method: 'post',
    data
  })
}

/**
 * 职务编辑
 */
export function postEdit(data) {
  return axios({
    url: api.postEdit,
    method: 'post',
    data
  })
}

/**
 * 职务删除
 */
export function postRemove(data) {
  return axios({
    url: api.postRemove,
    method: 'post',
    data
  })
}

/**
 * 职务列表
 */
export function staffList(params) {
  return axios({
    url: api.staffList,
    method: 'get',
    params
  })
}

/**
 * 职务详情
 */
export function staffGet(params) {
  return axios({
    url: api.staffGet,
    method: 'get',
    params
  })
}

/**
 * 职务新增
 */
export function staffCreate(data) {
  return axios({
    url: api.staffCreate,
    method: 'post',
    data
  })
}

/**
 * 职务编辑
 */
export function staffEdit(data) {
  return axios({
    url: api.staffEdit,
    method: 'post',
    data
  })
}

/**
 * 职务删除
 */
export function staffRemove(data) {
  return axios({
    url: api.staffRemove,
    method: 'post',
    data
  })
}

/**
 * 总会会员列表
 */
export function headquartersPageList(data) {
  return axios({
    url: api.headquartersPageList + `?current=${data.current}&size=${data.size}`,
    method: 'post',
    data
  })
}

/**
 * 单位在单位列表展示
 */
export function MemberCompanyShow(data) {
  return axios({
    url: api.memberCompanyShow + '/' + data.id + '/' + data.status,
    method: 'post'
  })
}

/**
 * 负责人在人脉列表展示
 */
export function MemberLeadingShow(data) {
  return axios({
    url: api.memberLeadingShow + '/' + data.id + '/' + data.status,
    method: 'post'
  })
}

/**
 * 负责人列表
 */
export function responsiblePersonList(params) {
  return axios({
    url: api.responsiblePersonList,
    method: 'get',
    params
  })
}

/**
 * 负责人新增
 */
export function responsiblePersonAdd(data) {
  return axios({
    url: api.responsiblePersonAdd,
    method: 'post',
    data
  })
}

/**
 * 负责人编辑
 */
export function responsiblePersonUpdate(data) {
  return axios({
    url: api.responsiblePersonUpdate,
    method: 'post',
    data
  })
}

/**
 * 负责人删除
 */
export function responsiblePersonDel(data) {
  return axios({
    url: api.responsiblePersonDel + '/' + data.ids,
    method: 'delete'
  })
}

/**
 * 主要成员列表
 */
export function leadingMemberList(params) {
  return axios({
    url: api.leadingMemberList,
    method: 'get',
    params
  })
}

/**
 * 总会负责人，带openid
 */
export function queryNotRegistration(data) {
  return axios({
    url: api.queryNotRegistration + `?current=${data.current}&size=${data.pageSize}`,
    method: 'post',
    data
  })
}

/**
 * 主要成员新增
 */
export function leadingMemberAdd(data) {
  return axios({
    url: api.leadingMemberAdd,
    method: 'post',
    data
  })
}

/**
 * 主要成员编辑
 */
export function leadingMemberUpdate(data) {
  return axios({
    url: api.leadingMemberUpdate,
    method: 'post',
    data
  })
}

/**
 * 主要成员详情
 */
export function leadingMemberDetail(params) {
  return axios({
    url: api.leadingMemberDetail,
    method: 'get',
    params
  })
}

/**
 * 主要成员删除
 */
export function leadingMemberDel(data) {
  return axios({
    url: api.leadingMemberDel + '/' + data.ids,
    method: 'delete'
  })
}

/**
 * 总会基本信息
 */
export function headquartersSettingBaseGet(params) {
  return axios({
    url: api.headquartersSettingBaseGet,
    method: 'get',
    params
  })
}

/**
 * 总会基本信息新增编辑
 */
export function headquartersSettingBaseCreateOrEdit(data) {
  return axios({
    url: api.headquartersSettingBaseCreateOrEdit,
    method: 'post',
    data
  })
}

/**
 * 视频浏览入口
 */
export function extVideoGet(params) {
  return axios({
    url: api.extVideoGet,
    method: 'get',
    params
  })
}

/**
 * 视频浏览入口新增编辑
 */
export function extVideoCreateOrEdit(data) {
  return axios({
    url: api.extVideoCreateOrEdit,
    method: 'post',
    data
  })
}

/**
 * 获取组织架构图
 */
export function structureImgGet() {
  return axios({
    url: api.structureImgGet,
    method: 'get'
  })
}

/**
 * 设置组织架构图
 */
export function structureImgCreateOrEdit(data) {
  return axios({
    url: api.structureImgCreateOrEdit,
    method: 'post',
    data
  })
}

/**
 * 总会使命愿景
 */
export function extVisionList(params) {
  return axios({
    url: api.extVisionList,
    method: 'get',
    params
  })
}

/**
 * 总会使命愿景新增编辑
 */
export function extVisionCreateOrEdit(data) {
  return axios({
    url: api.extVisionCreateOrEdit,
    method: 'post',
    data
  })
}

/**
 * 总会使命愿景删除
 */
export function extVisionRemove(params) {
  return axios({
    url: api.extVisionRemove,
    method: 'post',
    params
  })
}

/**
 * 总会服务 大标题
 */
export function extBigGet(params) {
  return axios({
    url: api.extBigGet,
    method: 'get',
    params
  })
}

/**
 * 总会服务 大标题新增编辑
 */
export function extBigCreateOrEdit(data) {
  return axios({
    url: api.extBigCreateOrEdit,
    method: 'post',
    data
  })
}

/**
 * 总会服务 小标题 明细
 */
export function extSmallDetailList(params) {
  return axios({
    url: api.extSmallDetailList,
    method: 'get',
    params
  })
}

/**
 * 总会服务 小标题 明细新增编辑
 */
export function extSmallDetailCreateOrEdit(data) {
  return axios({
    url: api.extSmallDetailCreateOrEdit,
    method: 'post',
    data
  })
}

/**
 * 总会服务 小标题 明细删除
 */
export function extSmallDetailRemove(params) {
  return axios({
    url: api.extSmallDetailRemove,
    method: 'post',
    params
  })
}

/**
 * 风采展示列表
 */
export function elegantlList(params) {
  return axios({
    url: api.elegantlList,
    method: 'get',
    params
  })
}

/**
 * 风采展示新增
 */
export function elegantlAdd(data) {
  return axios({
    url: api.elegantlAdd,
    method: 'post',
    data
  })
}

/**
 * 风采展示编辑
 */
export function elegantlEdit(data) {
  return axios({
    url: api.elegantlEdit,
    method: 'post',
    data
  })
}

/**
 * 风采展示删除
 */
export function elegantlDel(params) {
  return axios({
    url: api.elegantlDel + '/' + params.id,
    method: 'post',
    params
  })
}

/**
 * 基地平台
 */
export function extPlatformList(params) {
  return axios({
    url: api.extPlatformList,
    method: 'get',
    params
  })
}

/**
 * 基地平台新增编辑
 */
export function extPlatformCreateOrEdit(data) {
  return axios({
    url: api.extPlatformCreateOrEdit,
    method: 'post',
    data
  })
}

/**
 * 基地平台删除
 */
export function extPlatformRemove(params) {
  return axios({
    url: api.extPlatformRemove,
    method: 'post',
    params
  })
}

/**
 * 基地平台 明细
 */
export function extPlatformDetailList(params) {
  return axios({
    url: api.extPlatformDetailList,
    method: 'get',
    params
  })
}

/**
 * 基地平台 明细新增编辑
 */
export function extPlatformDetailCreateOrEdit(data) {
  return axios({
    url: api.extPlatformDetailCreateOrEdit,
    method: 'post',
    data
  })
}

/**
 * 基地平台 明细删除
 */
export function extPlatformDetailRemove(params) {
  return axios({
    url: api.extPlatformDetailRemove,
    method: 'post',
    params
  })
}

/**
 * 入会列表
 */
export function headquartersRuleList() {
  return axios({
    url: api.headquartersRuleList,
    method: 'get'
  })
}

/**
 * 修改入会
 */
export function headquartersRuleEdit(data) {
  return axios({
    url: api.headquartersRuleEdit,
    method: 'post',
    data
  })
}

/**
 * 组织架构人员列表
 */
export function orgStructList(params) {
  return axios({
    url: api.orgStructList + '/' + params.orgType + '/' + params.postId,
    method: 'get',
    params
  })
}

/**
 * 组织架构人员新增编辑
 */
export function orgStructCreateOrEdit(data) {
  return axios({
    url: api.orgStructCreateOrEdit + '/' + data.orgType + '/' + data.job,
    method: 'post',
    data
  })
}

/**
 * 组织架构人员删除
 */
export function orgStructRemove(params) {
  return axios({
    url: api.orgStructRemove,
    method: 'post',
    params
  })
}

/**
 * 组织成员模板
 */
export function staticExcel(params) {
  axios({
    url: api.staticExcel + '/' + params.templateName,
    method: 'get',
    responseType: 'blob',
    timeout: 0
  }).then(res => {
    resolveUrl(res, mimeMap.xlsx, params.templateName)
  })
}

/**
 * 组织成员导入
 */
export function orgStructExcelImport(data, type) {
  return axios({
    url: api.orgStructExcelImport + '/' + type,
    method: 'post',
    data,
    responseType: 'blob',
    timeout: 0,
    headers: { 'Content-Type': mimeMap.xlsx }
  })
}

/**
 * 修改密码
 */
export function accountsresetMemberPwd(data) {
  return axios({
    url: api.accountsresetMemberPwd,
    method: 'post',
    data
  })
}

/**
 * 总会会员主要负责人导出模板
 */
export function leadingMemberExportTemplate() {
  axios({
    url: api.leadingMemberExportTemplate,
    method: 'get',
    responseType: 'blob',
    timeout: 0
  }).then(res => {
    resolveBlob(res, mimeMap.xlsx)
  })
}

/**
 * 总会会员主要负责人导出
 */
export function leadingMemberExportEecel(params) {
  axios({
    url: api.leadingMemberExportEecel,
    method: 'get',
    responseType: 'blob',
    timeout: 0,
    params
  }).then(res => {
    resolveBlob(res, mimeMap.xlsx)
  })
}

/**
 * 总会会员主要负责人导入
 */
export function leadingMemberImportExcel(data) {
  return axios({
    url: api.leadingMemberImportExcel,
    method: 'post',
    data,
    responseType: 'blob',
    headers: { 'Content-Type': mimeMap.xlsx }
  })
}

/**
 * 总会会员主要成员导出模板
 */
export function responsiblePersonExportTemplate() {
  axios({
    url: api.responsiblePersonExportTemplate,
    method: 'get',
    responseType: 'blob',
    timeout: 0
  }).then(res => {
    resolveBlob(res, mimeMap.xlsx)
  })
}

/**
 * 总会会员主要成员导出
 */
export function responsiblePersonExportEecel(params) {
  axios({
    url: api.responsiblePersonExportEecel,
    method: 'get',
    responseType: 'blob',
    timeout: 0,
    params
  }).then(res => {
    resolveBlob(res, mimeMap.xlsx)
  })
}

/**
 * 总会会员主要成员导入
 */
export function responsiblePersonImportExcel(data) {
  return axios({
    url: api.responsiblePersonImportExcel,
    method: 'post',
    data,
    responseType: 'blob',
    timeout: 0,
    headers: { 'Content-Type': mimeMap.xlsx }
  })
}

/**
 * 服务明细恢复
 */
export function extSamllDetailRecover(params) {
  return axios({
    url: api.extSamllDetailRecover,
    method: 'post',
    params
  })
}

/**
 * 基地明细恢复
 */
export function extPlatformDetailRecover(params) {
  return axios({
    url: api.extPlatformDetailRecover,
    method: 'post',
    params
  })
}

/**
 * 组织成员明细恢复
 */
export function orgStructRecover(params) {
  return axios({
    url: api.orgStructRecover,
    method: 'post',
    params
  })
}

/**
 * 基本信息变更详情
 **/
export function headquartersInfo4Review(params) {
  return axios({
    url: api.headquartersInfo4Review,
    method: 'get',
    params
  })
}

/**
 * 主要负责人变更详情
 **/
export function leadingMemberPageList4Review(params) {
  return axios({
    url: api.leadingMemberPageList4Review,
    method: 'get',
    params
  })
}

/**
 * 主要成员变更详情
 **/
export function responsiblePersonPageList4Review(params) {
  return axios({
    url: api.responsiblePersonPageList4Review,
    method: 'get',
    params
  })
}

/**
 * 荣誉变更详情
 **/
export function honorPageList4Review(params) {
  return axios({
    url: api.honorPageList4Review,
    method: 'get',
    params
  })
}

/**
 * 审核
 **/
export function headquartersReview(data, params) {
  return axios({
    url: api.headquartersReview + '/' + data.id + '/' + data.status,
    method: 'post',
    params
  })
}

/**
 * 用户导出模板
 */
export function userExportTemplate() {
  axios({
    url: api.userExportTemplate,
    method: 'get',
    responseType: 'blob',
    timeout: 0
  }).then(res => {
    resolveBlob(res, mimeMap.xlsx)
  })
}

/**
 * 用户导出
 */
export function userExportExcel(params) {
  axios({
    url: api.userExportExcel,
    method: 'get',
    responseType: 'blob',
    timeout: 0,
    params
  }).then(res => {
    resolveBlob(res, mimeMap.xlsx)
  })
}
/**
 * 用户导入
 */
export function userImportExcel(data) {
  return axios({
    url: api.userImportExcel,
    method: 'post',
    data,
    responseType: 'blob',
    timeout: 0,
    headers: { 'Content-Type': mimeMap.xlsx }
  })
}

/**
 * 职员导出
 */
export function staffExportExcel(params) {
  axios({
    url: api.staffExportExcel,
    method: 'get',
    responseType: 'blob',
    timeout: 0,
    params
  }).then(res => {
    resolveBlob(res, mimeMap.xlsx)
  })
}
/**
 * 职员导入
 */
export function staffImportExcel(data) {
  return axios({
    url: api.staffImportExcel,
    method: 'post',
    data,
    responseType: 'blob',
    timeout: 0,
    headers: { 'Content-Type': mimeMap.xlsx }
  })
}

/**
 * 获取小程序、公众号链接
 */
export function getAuthUrl(params) {
  return axios({
    url: api.getAuthUrl,
    method: 'get',
    params
  })
}

/**
 * 获取授权状态
 */
export function getAuthStatus(params) {
  return axios({
    url: api.getAuthStatus,
    method: 'get',
    params
  })
}

/**
 * 获取小程序域名列表
 */
export function DomainList() {
  return axios({
    url: api.domainList + `?tenantId=${tenantId}`,
    method: 'get'
  })
}

/**
 * 下载校验文件
 */
export function DownLoadVerifFile() {
  return axios({
    url: api.downLoadVerifFile + `?tenantId=${tenantId}`,
    method: 'get'
  })
}

/**
 * 域名操作
 */
export function DomainAction(data) {
  return axios({
    url: api.domainAction + `?tenantId=${tenantId}`,
    method: 'post',
    data
  })
}

/**
 * 人员列表筛选数据-全局通用
 */
export function MemberInfoSearchVoList(data) {
  return axios({
    url: '/admin/member/statistics/getMemberInfoSearchVoList' + `?current=${data.current}&size=${data.size}`,
    method: 'post',
    timeout: 60000,
    data,
  })
}

/**
 * 人员列表全选数据-全局通用
 */
export function AllMemberInfoStatisticsVo(data) {
  return axios({
    url: '/admin/member/statistics/allMemberInfoStatisticsVo',
    method: 'post',
    data
  })
}

/**
 * 缴费管理列表
 */
export function memberPaymenrecord(params) {
  return axios({
    url: `/admin/mp/member-paymenrecord/memberPageList`,
    method: 'get',
    params
  })
}

/**
 * 导出续费管理列表
 */
export function memberPaymenExportExcel(params) {
  axios({
    url: `/admin/mp/member-paymenrecord/memberPaymenExportExcel`,
    method: 'get',
    responseType: 'blob',
    timeout: 0,
    params
  }).then(res => {
    resolveBlob(res, mimeMap.xlsx)
  })
}

/**
 * 公众号模版消息列表
 */
export function getMessageTemplateList() {
  return axios({
    url: `/admin/org/messageTemplate/map/getList`,
    method: 'get',
  })
}

/**
 * 刷新模板消息
 * @returns 
 */
export function refreshTemplates() {
  return axios({
    url: `/admin/org/messageTemplate/map/refreshTemplates`,
    method: 'post',
  })
}